import { Component, OnInit } from '@angular/core';
import { ColumnType, SPage } from '@shared/components/table-page/table-page.component';
import { ApiService } from '@core/services/api';
import { UtilService } from '@core/services/util.service';
import { StartupService } from '@core';
import { DicService } from '@core/services/dic.service';

@Component({
  selector: 'app-device-list',
  templateUrl: './device-list.component.html',
  styles: []
})
export class DeviceListComponent implements OnInit {
  config: SPage = {
    columns: [
      {
        title: '设备ID',
        index: 'deviceId',
      },{
        title: '楼栋编号',
        index: 'dhHouseCode',
      },{
        title: '所属村',
        index: 'dhAreaName',
        filter: {
          type: 'dateRange'
        }
      },{
        title: '安装位置',
        index: 'dhAddress',
        filter: {
          type: 'date'
        }
      },
      {
        title: '所属运营商',
        index: 'deviceOperator',
        filter: {
          items: this.util.dicMap.get('YYS'),
          type: 'select'
        }
      },{
        title: '设备厂商',
        index: 'deviceFacCode',
        filter: {
          items: this.util.dicMap.get('SBCS'),
          type: 'select'
        }
      },{
        title: '设备类型',
        index: 'deviceTypeCode',
        filter: {
          items: [],
          type: 'string'
        }
      },{
        title: '承建单位',
        index: 'dhContractUnit',
        filter: {
          type: 'string'
        }
      },{
        title: '维护单位',
        index: 'dhMaintainUnit',
        filter: {
          type: 'string'
        }
      },
      {
        title: '注册时间',
        index: 'dhRegisterTime'
      }
    ],
    editBtn: [
      {title: '查看'}
    ],
    reqUrl: this.api.device.page.url,
    showCheckBox: true,
    data: [
      {id: '1', deviceId: '23222222'},
      {id: '2', deviceId: '23222222'},
      {id: '3', deviceId: '23222222'}
    ]
  }
  constructor(
    private api: ApiService,
    public util: UtilService,
    private start: StartupService,
    private dic: DicService
  ) { }
  ngOnInit() {

  }

}
